UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uy4CnTI69tjDuoic3+GsZI+QODJXgeAA0PMACQwG2vQ=' 
WHERE 
  key_id = '0fc69482ea0e288671623e0ca2fb5164d9f2420c44b0d0cae5a0924f1915e9ee' 
  AND (
    token = 'Uy4CnTI69tjDuoic3+GsZI+QODJXgeAA0PMACQwG2vQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036