UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RL0gK4+wItVIsqBcougrZ2GM/inpFyGWT8lyZdLdcCk=' 
WHERE 
  key_id = 'da0b51c24ae2c70ae2840cf8dbfc741062f84d325d591dc58b10fb9c61abe95e' 
  AND (
    token = 'RL0gK4+wItVIsqBcougrZ2GM/inpFyGWT8lyZdLdcCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034