UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FwhZprJ38CNZBITazYDuFB5PM5ouuOJvcxfPnelcX6E='
WHERE
key_id = '801934c19b4fe42b80582feaefecf8131e9ee5d0c01e6ba573f6bbbe428312d8'
AND (
token = 'FwhZprJ38CNZBITazYDuFB5PM5ouuOJvcxfPnelcX6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)