UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nqT2/HxiMlIJPndyAvDdIfY3u3JdtSBOvfGYnZ2RhGw=' 
WHERE 
  key_id = '8549619a539b8ae104ac5dfaef6eea54642f4de7a618c3f110ea07aa11f2a204' 
  AND (
    token = 'nqT2/HxiMlIJPndyAvDdIfY3u3JdtSBOvfGYnZ2RhGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032