UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fntojeIJmt/w31gUqFXleUuLbZo/fV3d32U7PYGdy/E='
WHERE
key_id = '23173d3f791c43e61242f01cc72cc959fabe97267274a522be30df29014ddeda'
AND (
token = 'fntojeIJmt/w31gUqFXleUuLbZo/fV3d32U7PYGdy/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)