UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iRf5W7zaA2YTm0LWDUK1arHeBOvbucYOdRK/bXkAD5g='
WHERE
key_id = '80983eaa7b9ea00c8d6092e2c9ac9d9ed6889f2c0cd8631c49904f46e2371673'
AND (
token = 'iRf5W7zaA2YTm0LWDUK1arHeBOvbucYOdRK/bXkAD5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)