UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UkV8tBR++geXaHlj57inIrfDVk2DqqyBgLdD16isvcM=' 
WHERE 
  key_id = 'a056a77ab4d296382de3d42104759a46b8119c9b92481848dc2432a0d130e44d' 
  AND (
    token = 'UkV8tBR++geXaHlj57inIrfDVk2DqqyBgLdD16isvcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055