UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QY2gb+DnoO+O0yTie2XROWLwx1a6RVjkWdwM4+J5Z8k=' 
WHERE 
  key_id = '705620ffb7d0751f20fc401a781814347eda640c6f9bdb97578fd32776bd8ab9' 
  AND (
    token = 'QY2gb+DnoO+O0yTie2XROWLwx1a6RVjkWdwM4+J5Z8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031