UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FPNlfA7Zo4H7A2inu+f/IUpnSDTXp5FNCDLAkFdtFQU='
WHERE
key_id = '2b5cda19fb5a184a219f746eea41e0743317d3d3a41928f5e59a6fec777cfa58'
AND (
token = 'FPNlfA7Zo4H7A2inu+f/IUpnSDTXp5FNCDLAkFdtFQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)