UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U48nLffJilNW4ixu4nmTFFCERZH8FCcBpcfacfdZV7w=' 
WHERE 
  key_id = 'a8523a8de8d979727c1af6a8d9ee0a45f049baae55614fd8e8e63b700bbeb74c' 
  AND (
    token = 'U48nLffJilNW4ixu4nmTFFCERZH8FCcBpcfacfdZV7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021