UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FAWa59zDqSW09cuxl5lWiMLKJuvmHR/LIHqU0FnT/Sc='
WHERE
key_id = '6227a92251a77f78886cd7697399583f8187bdafb8b547fc225f2f08e4ac5394'
AND (
token = 'FAWa59zDqSW09cuxl5lWiMLKJuvmHR/LIHqU0FnT/Sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)