UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hGcfoJhtM08QbUeTSI3k+G8GsgNMKEQevscSEqrNwT8='
WHERE
key_id = '89426cce58d5b36c1be6ba2c7d9c93fa5c1d43d40806c10403790e14a1cb72e2'
AND (
token = 'hGcfoJhtM08QbUeTSI3k+G8GsgNMKEQevscSEqrNwT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)