UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0qbW0KuUEYQsqIf3IfWnhXhuZaBz2Ocl2QUO4hoVcRQ=' 
WHERE 
  key_id = '73e273f486f233e7749853790eefe638730b122ffd4db7d3c813d58933f673b9' 
  AND (
    token = '0qbW0KuUEYQsqIf3IfWnhXhuZaBz2Ocl2QUO4hoVcRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034