UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zqvu6tKQV321isJ/Xp5iVhXWNYBkT/Z6SH8CejEYOeM='
WHERE
key_id = '224129061309cd72a1e03cf7417e9fc1016e6bc8dbb3b34409d2bfe754b3bc0a'
AND (
token = 'Zqvu6tKQV321isJ/Xp5iVhXWNYBkT/Z6SH8CejEYOeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)