UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kQx5HES0rY4IyN7d7cM0RUokbOrz5CH4CgcX4/FPbho=' 
WHERE 
  key_id = '87fa01dac0372736a5341d2bce618e2ea581c8b17330d7649e26eed20d71b1d2' 
  AND (
    token = 'kQx5HES0rY4IyN7d7cM0RUokbOrz5CH4CgcX4/FPbho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040