UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RfCUGYqpVr1oeunhHRj3z9wo9BMbtGiEnaBkNRUz5C4=' 
WHERE 
  key_id = '869b2955facf3fdbd5e6b025a7f710c3ea3cc7fb27e1f634155c2b0ceed9c197' 
  AND (
    token = 'RfCUGYqpVr1oeunhHRj3z9wo9BMbtGiEnaBkNRUz5C4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033