UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FCbgYbWFmwHOhtiNBW5sF3R+7qFMJHoJ8g1Ey28vBWU='
WHERE
key_id = '8c9c5adf5c13f46d60af82e6fc35b0ffa4dfa77612ed8cc5909fee78855325ea'
AND (
token = 'FCbgYbWFmwHOhtiNBW5sF3R+7qFMJHoJ8g1Ey28vBWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)