UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fex8BuboALW45ah8x8P+d/1xuiq+ZGFehbmtpAJpQ4M='
WHERE
key_id = '944a9720023d423e74216f57cbe1c7569f5fe0589ec6cab1169f46aa0a08f06d'
AND (
token = 'fex8BuboALW45ah8x8P+d/1xuiq+ZGFehbmtpAJpQ4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)