UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWRwCEbrjLYf7rlkN//uld5+112QyBx63HbsnDnyZmQ=' 
WHERE 
  key_id = 'aab2f67e5886f9ca73ad78f8d9b24dfe0b8fb5ce0bf42577dd4ea5da9f1b0b6f' 
  AND (
    token = 'UWRwCEbrjLYf7rlkN//uld5+112QyBx63HbsnDnyZmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048