UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'POxgdr6vQqf8hU33diioAcVsSVp+rYkWq7RkOGqxzfY='
WHERE
key_id = '00f618ea8f1d715c9555f059e7a1ede0539b79f7e53a2985caf143bd04a5847b'
AND (
token = 'POxgdr6vQqf8hU33diioAcVsSVp+rYkWq7RkOGqxzfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)