UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RcG4OY7+/++u00icoNX8emiCBI9+JcWN5SkVo0ggDn0='
WHERE
key_id = '14edf3877d8455d2274b72cc58041c2caeb9b718976fbb8caf18864384ce6016'
AND (
token = 'RcG4OY7+/++u00icoNX8emiCBI9+JcWN5SkVo0ggDn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)