UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7YDkmg25TmGX9b4ZpDJrxU1T70v+GczN1pDm8/kHqU='
WHERE
key_id = 'f70dd33382ada7b434e8bde7b4eba694e589c12a69a066bf94ec342384f0953a'
AND (
token = 'i7YDkmg25TmGX9b4ZpDJrxU1T70v+GczN1pDm8/kHqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)