UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jzoMrjMj+mtiJaAuqpskEfCiwzdlYJhC3nhOEkbMfyg='
WHERE
key_id = '3b96657935b5e6859cd6cda992ed71bca2fa9c36968555149b796d8ffa02d7c7'
AND (
token = 'jzoMrjMj+mtiJaAuqpskEfCiwzdlYJhC3nhOEkbMfyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)