UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QZ7GI+huCVfzIDjoAcOQ4UEeC0ZsEZNaY8n1xxE6DGU='
WHERE
key_id = 'abbd270948356828241d7af574cf9ec85754c755fc9e21c8c4a1d2e45ec0fb0e'
AND (
token = 'QZ7GI+huCVfzIDjoAcOQ4UEeC0ZsEZNaY8n1xxE6DGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)