UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EdRRlmkSJY2gx8xMfn0RXw/4FWa1AYZ0KH/KRsncVac=' 
WHERE 
  key_id = '34d94818ab15288ce902bdc02fa14ef7c8094cfd488d8478cffb2ee1b997e96a' 
  AND (
    token = 'EdRRlmkSJY2gx8xMfn0RXw/4FWa1AYZ0KH/KRsncVac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033