UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SLB72PywJnoFdrZwn6Ke9HORHRzEslVX57SFheQUzls='
WHERE
key_id = 'bc27dfd863ddf563d5ed4e79af1b8e62d3a46d5635a4dea308ef09d7b869abbc'
AND (
token = 'SLB72PywJnoFdrZwn6Ke9HORHRzEslVX57SFheQUzls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)