UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfXO5ge4UiFWYsLYK6UsL1zORncyXBpAhoSkF8I6PgU='
WHERE
key_id = '0fc7db32595954f50c8440484d98596df4ef9750e33ebace7b76546902dcbde0'
AND (
token = 'rfXO5ge4UiFWYsLYK6UsL1zORncyXBpAhoSkF8I6PgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)