UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RUkLZxN7P6DICGYb27bbrrCPwVWZoy/1Q3oFEYyLmSI='
WHERE
key_id = '18cabc8add381963f920324d77b3447ac33f5e671b38a2475662e02efee00f6e'
AND (
token = 'RUkLZxN7P6DICGYb27bbrrCPwVWZoy/1Q3oFEYyLmSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)