UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JHm99RkYKxX+o2AusBg4ghIlUfS2TOnNiij79d4BY3E='
WHERE
key_id = '292c34938a03ac8d94025e8ecb5325f529e1151e057176eeeaecf4ce61b0ceac'
AND (
token = 'JHm99RkYKxX+o2AusBg4ghIlUfS2TOnNiij79d4BY3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)