UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ScaZzi5bksvxgUmDSkQjCEqyIdYRX4chui4NlpRjZH0='
WHERE
key_id = '092f3a5f466a38ace41f818c18726164a01cf558647f6c18b809fb96b075b0db'
AND (
token = 'ScaZzi5bksvxgUmDSkQjCEqyIdYRX4chui4NlpRjZH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)