UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Luc/o9ajcjGG3pGQqc1AbiMYRL//d4/K9p/LpKN9iYM=' 
WHERE 
  key_id = '42c1d564074e80ea283ec3920b562a157cf5101d6bbc6e479dbbe0b53610a1e8' 
  AND (
    token = 'Luc/o9ajcjGG3pGQqc1AbiMYRL//d4/K9p/LpKN9iYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029