UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tBZ4J02/RbauLplQIVPR43QUarmtfMkcuWetv+zSHvg='
WHERE
key_id = 'becd757ddb1d72ccd9ee1030907f0b63ba48ef6e99810944dc5997e5bda3fdd9'
AND (
token = 'tBZ4J02/RbauLplQIVPR43QUarmtfMkcuWetv+zSHvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)