UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6uXUszPxgzUY9ztJSTMd5928UnC2dw8UheTdqcilzrg='
WHERE
key_id = '276692d07e537b4c6b444ca01833000f650482ef6b0839a7ad3ddc7bb35a5e4a'
AND (
token = '6uXUszPxgzUY9ztJSTMd5928UnC2dw8UheTdqcilzrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)