UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n6Um5G9EoR4hZlFvj6h1wrfzabUAtuERrWU/cidLvow=' 
WHERE 
  key_id = 'b33a840e21b252a790a9b1b8bc81a4f61f4396858304639ab578d0d2a0cd6e29' 
  AND (
    token = 'n6Um5G9EoR4hZlFvj6h1wrfzabUAtuERrWU/cidLvow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032